﻿#region Using Directives

    using System;

    using Csla;

    using MarketPulse.BusinessLogic.Core;
    using MarketPulse.Reporting.Core.Criteria;

#endregion

namespace MarketPulse.Reporting.Core
{
    /// <summary>
    /// This class represents a collection of ReportingAnswers
    /// </summary>
    [Serializable]
    [Csla.Server.ObjectFactory("MarketPulse.DataAccess.Factory.ReportingAnswerFactory, MarketPulse.DataAccess.Factory", "FetchInfoList")]
    public class ReportingAnswerInfoList : MarketPulseReadOnlyListBase<ReportingAnswerInfoList, ReportingAnswerInfo>
    {

        #region Constructors

        /// <summary>
        /// Default constructor is private in order to (try to) enforce construction
        /// only via the static factory methods provided.
        /// </summary>
        private ReportingAnswerInfoList()
        {
        }

        #endregion

        #region Methods

            #region Factory Methods

                /// <summary>
                /// Retrieves a list of ReportingAnswerInfo objects for a given ClientGUID and QuestionID.
                /// </summary>
                /// <param name="clientGUID">The ClientGUID to get ReportingAnswerInfo objects for.</param>
                /// <param name="questionID">The QuestionID to get ReportingAnswerInfo objects for.</param>
                /// <returns></returns>
                public static ReportingAnswerInfoList GetByClientGUIDAndQuestionID(Guid clientGUID, long questionID)
                {
                    return DataPortal.Fetch<ReportingAnswerInfoList>(new ClientGUIDAndQuestionIDCriteria(clientGUID, questionID));
                }

            #endregion

        #endregion
    }
}
